#grpc-form {
    font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1.0em;
}

.grpc-desc {
    margin-bottom: 0;
}

.grpc-desc td {
    vertical-align: top;
}

#grpc-desc-selects td {
    padding-top: 8px;
}

.grpc-desc select {
    height: 30px;
    font-size: 14px;
}

.grpc-desc pre {
    margin: 0 0 0 36px;
    padding-left: 20px;
    border-left: 1px solid #d8d8d8;
    color: #777;
}

button#grpc-descriptions-toggle {
    position: absolute;
    z-index: 3;
    padding: 0;
    margin-top: 6px;
    margin-left: 10px;
    border: none;
    background: white;
    font-size: 150%;
}

.grpc-desc div.grpc-form-label {
    font-size: 110%;
    width: 124px;
    line-height: 30px;
    text-align: right;
    margin-right: 12px;
}

#grpc-descriptions {
    width: 100%;
    overflow: scroll;
}

#grpc-service-description {
    padding-top: 6px;
}

#grpc-method-description {
    font-weight: bold;
    color: #333;
    padding-top: 12px;
    padding-bottom: 12px;
}

#grpc-service-description-end {
    padding-bottom: 10px;
}

#grpc-container {
    display: flex;
}

#grpc-request-examples-container {
    flex: 1;
    max-width: 200px;
    margin-right: 10px;
    margin-top: 25px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
}

#grpc-request-examples-container h3 {
    margin: 0;
    padding-top: 1px;
    padding-bottom: 9px;
    border-bottom: 1px solid #d8d8d8;
    text-align: center;
    font-size: 18px;
}

#grpc-request-response {
    margin-top: 24px;
    border: none;
    padding: 0;
    flex: 1;
}

#grpc-request-response ul.ui-tabs-nav {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

#grpc-request-response li.ui-tabs-tab {
    border: 1px solid #ccc;
    margin: 0 -1px 0 0;
    padding: 4px 8px;
    border-top-right-radius: 6px;
    border-top-left-radius: 6px;
}

#grpc-request-response li.ui-tabs-tab a:active {
    outline: 0;
}

#grpc-request-response li.ui-tabs-tab a:focus {
    outline: 0;
}

#grpc-request-response li.ui-tabs-active {
    background: none;
    z-index: 1;
    border: 1px solid #ccc;
    border-bottom: 1px solid white;
    color: black;
}

#grpc-request-response li.ui-tabs-active a {
    color: black;
}

#grpc-request-response .grpc-tabcontent.ui-tabs-panel {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-bottom-left-radius: 6px;
    position: relative;
    top: -1px;
    z-index: 0;
    border: 1px solid #ccc;
    margin: 0;
    padding: 20px;
}

#grpc-request-response .grpc-tabcontent.ui-tabs-panel h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: bold;
    font-size: 18px;
}

#grpc-request-examples {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

ol#grpc-request-examples {
    margin-top: 16px;
}

#grpc-request-examples li {
    padding: 10px;
}

#grpc-request-examples li:hover {
    background-color: #f4f4f4;
}

#grpc-request-examples .ui-selected {
    background: #f0f0f0;
    font-weight: 500;
}

#grpc-form button {
    border-radius: 3px;
    background: #f0f0f0;
    border-top: 1px solid #ccc;
    border-right: 1px solid #bbb;
    border-bottom: 1px solid #aaa;
    border-left: 1px solid #ccc;
    padding: 10px 20px;
    font-size: 110%;
}

#grpc-form button:disabled {
    border: 1px solid #ddd;
    color: #ccc;
    background: #f8f8f8;
}

#grpc-form textarea {
    width: 100%;
    border: 1px solid #aaa;
    margin-bottom: 16px;
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
}

textarea#grpc-request-raw-text {
    height: 200px;
}

#grpc-request-timeout {
    margin-bottom: 20px;
}

#grpc-request-timeout input {
    border: 1px solid #888;
}

table#grpc-request-metadata-form {
    margin: 0 0 0 4px;
    border-collapse: collapse;
}

#grpc-request-metadata-form th {
    background-color: #eee;
    border-bottom: 1px solid #ddd;
    color: #222;
    padding: 4px;
    text-align: center;
    font-size: 80%;
}

#grpc-request-metadata-form td {
    padding: 8px 0 0 8px;
}

#grpc-request-metadata-form td:first-child {
    padding-left: 0;
}

#grpc-request-metadata-form th.name {
    min-width: 208px;
}

#grpc-request-metadata-form th.value {
    min-width: 328px;
}

#grpc-request-metadata-form input {
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    border: 1px solid #888;
}

#grpc-request-metadata {
    margin-bottom: 20px;
}

#grpc-request-form {
    margin-bottom: 20px;
}

#grpc-request-form div#root {
    margin-left: 4px;
}

#grpc-request-form div.input_container {
    padding: 16px;
    border-radius: 2px;
    display: inline-block;
}

#grpc-request-form td {
    padding: 16px 0 0 16px;
    font-size: 13px;
}

#grpc-request-form td:first-of-type {
    padding-left: 0;
}

#grpc-request-form tr:first-of-type > td {
    padding-top: 0;
}

#grpc-request-form th {
    padding: 16px 0 0 16px;
    text-align: left;
    color: #888;
    font-weight: normal;
}

#grpc-request-form th:first-of-type {
    padding-left: 0;
}

#grpc-request-form tr:first-of-type > th {
    padding-top: 0;
}

#grpc-request-form h4 {
    padding: 0 0 3px 0;
    margin: 0;
    font-size: 95%;
    font-weight: bold;
    text-align: center;
    font-style: italic;
}

#grpc-request-form textarea {
    margin: 0;
    width: auto;
}

#grpc-request-form td.toggle_presence span.required {
    margin: 0 8px 0 18px;
    color: #aaa;
}

#grpc-request-form td.toggle_presence {
    text-align: center;
}

#grpc-request-form td input[type=checkbox] {
    margin: 0 8px 0 18px;
}

#grpc-request-form td input[type=radio] {
    margin: 0;
}

#grpc-request-form td.empty_message {
    text-align: center;
    font-style: italic;
}

#grpc-request-form td.name {
    text-align: right;
    font-family: "Courier New", Courier, monospace;
    font-size: 75%;
}

#grpc-request-form td.oneof_none {
    text-align: right;
    font-family: "Courier New", Courier, monospace;
    font-size: 90%;
    font-style: italic;
    font-weight: bold;
}

#grpc-request-form td.name strong {
    font-size: 120%;
}

#grpc-request-form .grpc-bytes-container {
    display: flex;
    align-items: center;
}

#grpc-request-form .grpc-bytes-container label.grpc-file-button {
    border-radius: 2px;
    background: #f0f0f0;
    border-top: 1px solid #ccc;
    border-right: 1px solid #bbb;
    border-bottom: 1px solid #aaa;
    border-left: 1px solid #ccc;
    padding: 4px 8px;
    font-size: 90%;
}

#grpc-request-form .grpc-bytes-container label.grpc-file-button.disabled {
    border: 1px solid #ddd;
    color: #ccc;
    background: #f8f8f8;
}

.ui-tooltip.grpc-field-description {
    white-space: pre;
    font-family: "Courier New", Courier, monospace;
    max-width: none;
}

#grpc-request-form td.toggle_presence {
    width: 1px;
}

#grpc-request-form td.array_button {
    width: 1px;
}

#grpc-request-form div.json-entry {
    display: inline-block;
}

#grpc-request-form div.oneof {
    border-left: 2px dotted #ddd;
    border-radius: 8px;
    padding: 12px 0 12px 16px;
}

#grpc-request-form div.one-of-3 {
    border: 1px dashed #ccc;
}

#grpc-request-form div.two-of-3 {
    border: 1px dotted #d0d0d0;
}

#grpc-request-form div.three-of-3 {
    border: 1px solid #ddd;
}

#grpc-request-form div.input_container button {
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
}

#grpc-form .grpc-request-table button {
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    font-family: "Courier New", Courier, monospace;
}

#grpc-form .grpc-request-table button.delete {
    background-color: #f66;
    color: white;
    border: 1px solid #c44;
}

#grpc-form .grpc-request-table button.add {
    background-color: #0c0;
    color: white;
    border: 1px solid #090;
}

#grpc-request-form textarea:disabled {
    color: #ccc;
    border: 1px solid #ddd;
}

#grpc-request-form select:disabled {
    color: #ccc;
}

#grpc-request-form input[type=text]:disabled {
    color: #ccc;
    border: 1px solid #ccc;
}

#grpc-request-form input[type=text] {
    border: 1px solid #aaa;
}

#grpc-request-form .unknown {
    color: #fa6;
    font-style: italic;
    font-size: 90%;
}

#grpc-request-form tr.unknown td {
    padding-top: 0;
}

#grpc-request-form .null {
    color: #ccc;
    font-style: italic;
}

#grpc-request-form .duration-unit {
    font-style: italic;
    margin-left: 6px;
}

#grpc-request-form div.grpc-timestamp {
    display: inline-block;
}

#grpc-request-form div.grpc-timestamp > input {
    margin: 4px;
}

#grpc-request-form .invalid-input {
    border: 3px dotted #f46;
    background-color: #ffe0e8;
}

#grpc-request-form input[type=text].invalid-input {
    border: 3px dotted #f46;
}

#grpc-request-form textarea.invalid-input {
    border: 3px dotted #f46;
}

#grpc-request-form div.invalid-input input {
    background-color: #ffe0e8;
}

#grpc-request-timeout input.invalid-input {
    border: 3px dotted #f46;
    background-color: #ffe0e8;
}

.grpc-timestamp-picker.ui-datepicker span.ui-icon {
    background: none;
    text-indent: 0;
    font-size: 12px;
    font-weight: normal;
    text-align: center;
}

#grpc-request-form .bool-input {
    padding: 3px;
    display: inline-block;
}

#grpc-request-form label {
    font-weight: normal;
    margin: 0 15px 0 8px;
}

#grpc-request-form label.disabled {
    color: #ccc;
}

#grpc-form span.add-row-label {
    font-size: 13.2px;
    margin: 2px;
}

.grpc-metadata-table td, .grpc-metadata-table th {
    padding: 8px;
    border: 1px solid #eee;
    font-family: "courier new", courier, monospace;
    font-size: 14px;
}

.grpc-metadata-table td.none {
    border: none;
    font-style: italic;
    padding: 0;
}

textarea.grpc-response-textarea {
    font-family: "Courier New", Courier, monospace;
    height: 200px;
}

#grpc-response-error-details textarea.grpc-response-textarea {
    height: 100px;
}

#grpc-response-error-details-container h4 {
    margin: 12px 0 6px 0;
    font-size: 90%;
}

#grpc-response-req-stats {
    font-size: 110%;
    padding-bottom: 8px;
    color: #800;
    font-style: italic;
}

#grpc-response-headers {
    margin-bottom: 16px;
}

#grpc-response-data {
    padding-bottom: 16px;
}

#grpc-response-data td {
    padding: 12px 0 0 12px;
    font-size: 13px;
    font-family: "courier new", courier, monospace;
}

#grpc-response-data td.name {
    text-align: right;
    font-weight: bold;
}

#grpc-response-data tr:first-of-type > td {
    padding-top: 0;
}

#grpc-response-data td:first-of-type {
    padding-left: 0;
}

#grpc-response-data div.output_container.root {
    display: inline-block;
    margin-top: 16px;
}

#grpc-response-data div.output_container.root:first-of-type {
    margin-top: 0;
}

#grpc-response-data div.output_container {
    padding: 16px;
    border-radius: 2px;
}

#grpc-response-data .null {
    color: #ccc;
    font-style: italic;
}

#grpc-response-data div.one-of-3 {
    border: 1px dashed #ccc;
}

#grpc-response-data div.two-of-3 {
    border: 1px dotted #d0d0d0;
}

#grpc-response-data div.three-of-3 {
    border: 1px solid #ddd;
}

#grpc-response-error {
    font-size: 120%;
    color: #f44;
    padding-bottom: 16px;
}

#grpc-response-error #grpc-response-error-num {
    color: #faa;
}

#grpc-response-error #grpc-response-error-msg {
    font-size: 14px;
    font-family: "Courier New", Courier, monospace;
    color: #c00;
}

button#grpc-history-clear, button#grpc-history-save {
    margin-bottom: 16px;
    font-size: 96%;
    padding: 8px 15px;
}

#grpc-history-list button.delete {
    background-color: #f66;
    color: white;
    border: 1px solid #c44;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    font-family: "Courier New", Courier, monospace;
}

#grpc-history-list button.load {
    padding: 6px 12px 6px;
    font-size: 100%;
    margin: 0 24px;
}

#grpc-history-list .history-item-header {
    align-items: center;
    outline: none;
    background: inherit;
    border: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    margin: 0;
    padding: 10px;
}

#grpc-history-list .history-item-header.ui-state-active {
    color: #000;
}

#grpc-history-list > .ui-accordion:first-child {
    border-top: 1px solid #eee;
}

#grpc-history-list .history-item-panel {
    border-radius: 0;
}

#grpc-history-list .history-item-header span {
    display: inline-flex;
    align-items: center;
}

#grpc-history-list .history-item-header .history-item-time {
    width: 180px;
}

#grpc-history-list .history-item-header .history-item-duration {
    width: 80px;
}

#grpc-history-list .history-item-header .history-item-result {
    width: 144px;
}

#grpc-history-list .history-item-header .history-item-result.error {
    color: #a00;
}

#grpc-history-list .history-item-header .history-item-method {
    font-weight: bold;
}

#grpc-history-list .history-item-header .history-item-method.invalid-history {
    text-decoration: line-through;
    color: #800;
}

#grpc-history-list .history-item-header .history-item-messages {
    color: #888;
    font-size: 90%;
    padding-left: 30px;
}

#grpc-history-list .history-item-panel {
    background-color: #fcfcfc;
    padding: 1em;
}

#grpc-history-list .history-item-panel .history-detail-heading {
    font-weight: bold;
}

#grpc-history-list .history-item-panel .history-detail-request .request-json {
    font-size: 1.0em;
    font-family: "Courier New", Courier, monospace;
    margin: 1.0em 0 0 0;
}

#grpc-history-list .history-item-panel .history-detail-metadata .history-detail-heading {
    margin: 1.0em 0 0 0;
}

#grpc-history-list .history-item-panel .history-detail-metadata table {
    margin: 1.0em 0 0 0;
    font-size: 1.0em;
    font-family: "Courier New", Courier, monospace;
}

#grpc-history-list .history-item-panel .history-detail-metadata th {
    font-weight: bold;
    text-align: left;
    color: #555;
}

#grpc-history-list .history-item-panel .history-detail-metadata th:after {
    content: ":";
}

#grpc-history-list .history-item-panel .history-detail-metadata td {
    padding-left: 12px;
}

.grpc-request-raw-container {
    margin-top: 1em;
    margin-bottom: 1em;
}

.grpc-curl-panel {
    background-color: #fcfcfc;
    border: 1px solid #dddddd;
    padding: 1em;
    margin-bottom: 1em;
}

/* Dark mode - automatically detects system preference */
@media (prefers-color-scheme: dark) {
    #grpc-form {
        background-color: #1a1a1a;
        color: #e1e4e8;
        color-scheme: dark;
    }

    body {
        background-color: #1a1a1a;
        color: #e1e4e8;
    }

    #grpc-form a {
        color: #63a4ff;
    }

    #grpc-form .grpc-form-label,
    #grpc-form h3,
    #grpc-form h4 {
        color: #f0f6fc;
    }

    #grpc-form .grpc-desc pre {
        border-left: 1px solid #333;
        color: #6e7681;
    }

    #grpc-form #grpc-method-description {
        color: #f0f6fc;
    }

    button#grpc-descriptions-toggle {
        background: #21262d;
        color: #e1e4e8;
    }

    #grpc-form select,
    #grpc-form input,
    #grpc-form textarea {
        background-color: #21262d;
        color: #e1e4e8;
        border: 1px solid #444c56;
    }

    #grpc-form textarea:disabled,
    #grpc-form input[type=text]:disabled,
    #grpc-form select:disabled {
        background-color: #2a2a2a;
        color: #777;
        border-color: #2f2f2f;
    }

    #grpc-form button {
        background: #21262d;
        border: 1px solid #444c56;
        color: #e1e4e8;
    }

    #grpc-form button:hover {
        background: #30363d;
        border-color: #606166;
    }

    #grpc-form button:disabled {
        background: #2a2a2a;
        border: 1px solid #2f2f2f;
        color: #555;
    }

    #grpc-form #grpc-request-response ul.ui-tabs-nav {
        background: #161b22;
        border: none;
        padding: 0;
    }

    #grpc-form #grpc-request-response ul.ui-tabs-nav .ui-tabs-anchor {
        color: inherit;
    }

    #grpc-form #grpc-request-response li.ui-tabs-tab {
        border-color: #444c56;
        background: #21262d;
        color: #8b949e;
    }

    #grpc-form #grpc-request-response li.ui-tabs-tab.ui-tabs-disabled {
        background: #161b22;
        color: #484f58;
        border-color: #30363d;
    }

    #grpc-form #grpc-request-response li.ui-tabs-tab.ui-tabs-disabled a {
        color: #484f58 !important;
        cursor: not-allowed;
    }

    #grpc-form #grpc-request-response li.ui-tabs-active {
        border-color: #444c56;
        border-bottom-color: #1a1a1a;
        color: #f0f6fc;
        background: #1a1a1a;
    }

    #grpc-form #grpc-request-response li.ui-tabs-active a {
        color: #ffffff;
    }

    #grpc-form #grpc-request-response .grpc-tabcontent.ui-tabs-panel {
        border-color: #444c56;
        background-color: #1a1a1a !important;
        color: #e1e4e8;
    }

    #grpc-form .ui-tabs-panel {
        background-color: #1a1a1a !important;
        color: #e1e4e8;
    }

    #grpc-form #grpc-request-examples-container {
        border-color: #333;
        background-color: #1a1a1a;
    }

    #grpc-form #grpc-request-examples-container h3 {
        border-bottom-color: #333;
    }

    #grpc-form #grpc-request-examples li:hover {
        background-color: #242424;
    }

    #grpc-form #grpc-request-examples .ui-selected {
        background: #2d2d2d;
    }

    #grpc-form #grpc-request-metadata-form th {
        background-color: #1f1f1f;
        border-bottom-color: #333;
        color: #f2f2f2;
    }

    #grpc-form #grpc-request-metadata-form td {
        color: #f2f2f2;
    }

    #grpc-form #grpc-request-form div.input_container {
        background-color: #1a1a1a;
    }

    #grpc-form #grpc-request-form div.oneof {
        border-left-color: #444;
    }

    #grpc-form #grpc-request-form div.one-of-3 {
        border-color: #444;
    }

    #grpc-form #grpc-request-form div.two-of-3 {
        border-color: #444;
    }

    #grpc-form #grpc-request-form div.three-of-3 {
        border-color: #555;
    }

    #grpc-form #grpc-request-form .grpc-bytes-container label.grpc-file-button {
        background: #2a2a2a;
        border-color: #3c3c3c;
        color: #f2f2f2;
    }

    #grpc-form #grpc-request-form .grpc-bytes-container label.grpc-file-button.disabled {
        background: #242424;
        border-color: #333;
        color: #666;
    }

    #grpc-form #grpc-request-form .invalid-input {
        border-color: #d56a8a;
        background-color: #4a1d2b;
    }

    #grpc-form #grpc-request-form td.name {
        color: #c9d1d9;
    }

    #grpc-form #grpc-request-form td.name strong {
        color: #f2f2f2;
    }

    #grpc-form .grpc-metadata-table th {
        background-color: #1f1f1f;
        border-bottom-color: #333;
        color: #f2f2f2;
    }

    #grpc-form .grpc-metadata-table td,
    #grpc-form .grpc-metadata-table th {
        border-color: #333;
    }

    #grpc-form #grpc-response-data div.output_container {
        background-color: #1a1a1a;
        color: #e1e4e8;
    }

    #grpc-form #grpc-response-data,
    #grpc-form #grpc-response-data pre,
    #grpc-form #grpc-response-data code {
        color: #e1e4e8;
        background-color: #1a1a1a;
    }

    #grpc-form #grpc-response-data .null {
        color: #999999;
    }

    #grpc-form #grpc-response-data div.one-of-3 {
        border-color: #444;
    }

    #grpc-form #grpc-response-data div.two-of-3 {
        border-color: #444;
    }

    #grpc-form #grpc-response-data div.three-of-3 {
        border-color: #555;
    }

    #grpc-form #grpc-response-error {
        color: #ff6b6b;
    }

    #grpc-form #grpc-response-error #grpc-response-error-num,
    #grpc-form #grpc-response-error #grpc-response-error-msg {
        color: #ff8787;
    }

    #grpc-form #grpc-history-list .history-item-header {
        border-bottom-color: #333;
        color: #f2f2f2;
    }

    #grpc-form #grpc-history-list > .ui-accordion:first-child {
        border-top-color: #333;
    }

    #grpc-form #grpc-history-list .history-item-header .history-item-result.error {
        color: #ff8787;
    }

    #grpc-form #grpc-history-list .history-item-header .history-item-messages {
        color: #bbbbbb;
    }

    #grpc-form #grpc-history-list .history-item-panel {
        background-color: #1a1a1a;
        border: 1px solid #333;
    }

    #grpc-form .grpc-curl-panel {
        background-color: #1a1a1a;
        border-color: #333;
    }

    #grpc-form #grpc-request-form .duration-unit,
    #grpc-form #grpc-request-form label.disabled,
    #grpc-form #grpc-request-form td.empty_message {
        color: #bbbbbb;
    }

    /* Dark mode styles for jQuery UI datepicker */
    .ui-datepicker {
        background: #21262d !important;
        border: 1px solid #444c56 !important;
        color: #e1e4e8 !important;
    }

    .ui-datepicker-header {
        background: #30363d !important;
        border: 1px solid #444c56 !important;
        color: #f0f6fc !important;
    }

    .ui-datepicker-title {
        color: #f0f6fc !important;
    }

    .ui-datepicker-prev,
    .ui-datepicker-next {
        background: #30363d !important;
        border: 1px solid #444c56 !important;
        color: #e1e4e8 !important;
    }

    .ui-datepicker-prev:hover,
    .ui-datepicker-next:hover {
        background: #484f58 !important;
        border-color: #606166 !important;
    }

    .ui-datepicker-calendar {
        background: #21262d !important;
    }

    .ui-datepicker-calendar th {
        background: #30363d !important;
        color: #f0f6fc !important;
        border: 1px solid #444c56 !important;
    }

    .ui-datepicker-calendar td {
        background: #21262d !important;
        border: 1px solid #444c56 !important;
    }

    .ui-datepicker-calendar td a {
        color: #e1e4e8 !important;
        background: transparent !important;
        border: none !important;
    }

    .ui-datepicker-calendar td a:hover {
        background: #30363d !important;
        color: #f0f6fc !important;
    }

    .ui-datepicker-calendar .ui-datepicker-today a {
        background: #1f6feb !important;
        color: #ffffff !important;
    }

    .ui-datepicker-calendar .ui-state-active a {
        background: #238636 !important;
        color: #ffffff !important;
    }

    .ui-datepicker-buttonpane {
        background: #30363d !important;
        border: 1px solid #444c56 !important;
    }

    .ui-datepicker-buttonpane button {
        background: #21262d !important;
        border: 1px solid #444c56 !important;
        color: #e1e4e8 !important;
    }

    .ui-datepicker-buttonpane button:hover {
        background: #30363d !important;
        border-color: #606166 !important;
    }

    .ui-widget-content {
        background: #30363d !important;
    }

    hr {
        border-color: #606166 !important;
    }
}
